package jp.co.takapy.baycity.server.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.google.appengine.api.datastore.Key;
import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

@Model(schemaVersion = 1)
public class StationMst implements Serializable {

    private static final long serialVersionUID = 1L;

    @Attribute(primaryKey = true)
    private Key lineNo;

    @Attribute(version = true)
    private Long version;

    private String lineName;

    private Date revicedDate;

    private String stationId;

    private String stationName;

    private String directionUp;

    private String directionDown;

    /*
     *
     * @return the key
     */
    public Key getLineNo() {
        return lineNo;
    }

    /**
     * Sets the key.
     *
     * @param key
     *            the key
     */
    public void setLineNo(Key lineNo) {
        this.lineNo = lineNo;
    }

    /**
     * Returns the version.
     *
     * @return the version
     */
    public Long getVersion() {
        return version;
    }

    /**
     * Sets the version.
     *
     * @param version
     *            the version
     */
    public void setVersion(Long version) {
        this.version = version;
    }

    /**
     * @return lineName
     */
    public String getLineName() {
        return lineName;
    }

    /**
     * @param lineName セットする lineName
     */
    public void setLineName(String lineName) {
        this.lineName = lineName;
    }

    /**
     * @return revicedDate
     */
    public Date getRevicedDate() {

        return revicedDate;
    }

    /**
     * @param revicedDate セットする revicedDate
     */
    public void setRevicedDate(Date revicedDate) {
        this.revicedDate = revicedDate;
    }

    /**
     * @return stationId
     */
    public String getStationId() {
        return stationId;
    }

    /**
     * @param stationId セットする stationId
     */
    public void setStationId(String stationId) {
        this.stationId = stationId;
    }

    /**
     * @return stationName
     */
    public String getStationName() {
        return stationName;
    }

    /**
     * @param stationName セットする stationName
     */
    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    /**
     * @return directionUp
     */
    public String getDirectionUp() {
        return directionUp;
    }

    /**
     * @param directionUp セットする directionUp
     */
    public void setDirectionUp(String directionUp) {
        this.directionUp = directionUp;
    }

    /**
     * @return directionDown
     */
    public String getDirectionDown() {
        return directionDown;
    }

    /**
     * @param directionDown セットする directionDown
     */
    public void setDirectionDown(String directionDown) {
        this.directionDown = directionDown;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((lineNo == null) ? 0 : lineNo.hashCode());
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        StationMst other = (StationMst) obj;
        if (lineNo == null) {
            if (other.lineNo != null) {
                return false;
            }
        } else if (!lineNo.equals(other.lineNo)) {
            return false;
        }
        return true;
    }
}
